var express = require('express');
var path = require('path');
var server = express();

var port = process.env.port || 8081;

// Setup Views & View Engine
server.set('public', path.join(__dirname, 'public'));
server.engine('html', require('ejs').renderFile);
server.set('view engine', 'html');


// Define ./public as static
server.use(express.static(path.join(__dirname, 'public')));

//All GET's render index.html
server.get('*', function(req, res) {
    return res.render('index');
});

server.listen(port, function() {
    console.log('listening on port ' + port);
});